import React, { useMemo } from "react";
import { ResourceList } from "../../Component/ResourceList";
import { FormattedMessage } from "react-intl";

const ResourceCategory = () => {
    const columns = useMemo(() => ([{
        title: <FormattedMessage id="admin.pages.setting.options.name" />,
        dataIndex: "name",
        width: 80
    }, {
        title: <FormattedMessage id="admin.pages.setting.options.value" />,
        dataIndex: "dataValue"
    }]), []);
    const searchFields = useMemo<Admin.IAdvancedField[]>(() => ([{
        label: "配置名称",
        name: "name",
        type: "Input"
    }]), []);
    return (
        <ResourceList
            tableColumns={columns}
            searchFields={searchFields}
            tableWidth={800}
            listEndPoint={{
                endPoint: "setting.configList",
                "formatUri": () => ({
                    config: "resource"
                })
            }}
        />
    );
};

export default ResourceCategory;
